package org.apache.qpid.management.common.sasl;

import java.util.Map;
import org.apache.harmony.javax.security.auth.callback.CallbackHandler;
import org.apache.harmony.javax.security.sasl.SaslClient;
import org.apache.harmony.javax.security.sasl.SaslClientFactory;
import org.apache.harmony.javax.security.sasl.SaslException;

public class ClientSaslFactory
  implements SaslClientFactory
{
  public SaslClient createSaslClient(String[] paramArrayOfString, String paramString1, String paramString2, String paramString3, Map paramMap, CallbackHandler paramCallbackHandler)
    throws SaslException
  {
    int i = 0;
    while (true)
    {
      PlainSaslClient localPlainSaslClient;
      if (i >= paramArrayOfString.length)
        localPlainSaslClient = null;
      while (true)
      {
        return localPlainSaslClient;
        if (!(paramArrayOfString[i].equals("PLAIN")))
          break;
        localPlainSaslClient = new PlainSaslClient(paramString1, paramCallbackHandler);
      }
      ++i;
    }
  }

  public String[] getMechanismNames(Map paramMap)
  {
    String[] arrayOfString = new String[1];
    arrayOfString[0] = "PLAIN";
    return arrayOfString;
  }
}